ARD2  RC2
Airbag Reference Demonstrator using MPC5604P
Exceptions.c
00001   
00011 /*----------------------------------------------------------------------------*/
00012 /* Includes                                                                   */
00013 /*----------------------------------------------------------------------------*/
00014 
00015 #include "Exceptions.h" /* Implement functions from this file */
00016 
00017 /*----------------------------------------------------------------------------*/
00018 /* Function Implementations                                                   */
00019 /*----------------------------------------------------------------------------*/
00020 
00021 #pragma push /* Save the current state */
00022 /* Symbol EXCEPTION_HANDLERS is defined in the application linker command file (.lcf) 
00023    It is defined to the start of the code memory area used for the .__exception_handlers section. 
00024 */
00025 /*lint -esym(752, EXCEPTION_HANDLERS) */
00026 __declspec (section ".__exception_handlers") extern long EXCEPTION_HANDLERS;  
00027 #pragma force_active on
00028 #pragma function_align 16 /* We use 16 bytes alignment for Exception handlers */
00029 __declspec(interrupt)
00030 __declspec (section ".__exception_handlers")
00031 void EXCEP_DefaultExceptionHandler(void)
00032 {
00033 
00034 }
00035 #pragma force_active off
00036 #pragma pop
00037 
00038 __asm void EXCEP_InitExceptionHandlers(void)
00039 {
00040 nofralloc
00041 
00042     /* Set the IVPR to the Exception Handlers memory area defined in the lcf file */ 
00043     lis     r0, EXCEPTION_HANDLERS@h
00044     ori     r0, r0, EXCEPTION_HANDLERS@l
00045     mtivpr  r0
00046 
00047     /* Set all IVOR registers to the Default Exception Handler */
00048     lis     r0, EXCEP_DefaultExceptionHandler@h
00049     ori     r0, r0, EXCEP_DefaultExceptionHandler@l
00050 
00051 #if !defined(Z0H_CORE)
00052     /* IVORx registers are "hard-wired" in the e200z0 and z0h cores */
00053 
00054     /* IVOR0 Critical input (SPR 400) */
00055     mtivor0 r0
00056     /* IVOR1 Machine check interrupt (SPR 401) */
00057     mtivor1 r0
00058     /* IVOR2 Data storage interrupt (SPR 402) */
00059     mtivor2 r0
00060     /* IVOR3 Instruction storage interrupt (SPR 403) */
00061     mtivor3 r0
00062     /* IVOR4 External input interrupt (SPR 404) */
00063     mtivor4 r0
00064     /* IVOR5 Alignment interrupt (SPR 405) */
00065     mtivor5 r0
00066     /* IVOR6 Program interrupt (SPR 406) */
00067     mtivor6 r0
00068     /* IVOR7 Floating-point unavailable interrupt (SPR 407) */
00069     mtivor7 r0
00070     /* IVOR8 System call interrupt (SPR 408) */
00071     mtivor8 r0
00072     /* IVOR9 Auxiliary processor (SPR 409) */
00073     mtivor9 r0
00074     /* IVOR10 Decrementer interrupt (SPR 410) */
00075     mtivor10 r0
00076     /* IVOR11 Fixed-interval timer interrupt (SPR 411) */
00077     mtivor11 r0
00078     /* IVOR12 Watchdog timer interrupt (SPR 412) */
00079     mtivor12 r0
00080     /* IVOR13 Data TLB error interrupt (SPR 413) */
00081     mtivor13 r0        
00082     /* IVOR14 Instruction TLB error interrupt (SPR 414) */
00083     mtivor14 r0  
00084     /* IVOR15 Debug interrupt (SPR 415) */
00085     mtivor15 r0 
00086 
00087     /* IVOR32 SPE APU unavailable interrupt (SPR 528) */
00088     mtivor32 r0 
00089     /* IVOR33 SPE floating-point data exception interrupt (SPR 529) */
00090     mtivor33 r0 
00091     /* IVOR34 SPE floating-point round exception interrupt (SPR 530) */
00092     mtivor34 r0
00093 
00094 #endif
00095 
00096     blr
00097 }